package com.cloud.pole.weixin.biz;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.WxAppMapper;
import com.cloud.pole.mapper.WxMenuMapper;
import com.cloud.pole.weixin.model.entity.WxMenu;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class WxMenuBiz extends BaseBiz<WxMenuMapper, WxMenu> {
	@Autowired
	WxMenuMapper mapper;
	
    public List<WxMenu> selectWxMenuList(Integer wxAppId, Integer fatherMenuId) {
		 Example example = new Example( WxMenu.class);
		 Criteria criteria = example.createCriteria();
         criteria.andEqualTo("wxAppId", wxAppId);
         if(fatherMenuId != null) {
             criteria.andEqualTo("upMenuId", fatherMenuId);
         }
         else {
             criteria.andEqualTo("upMenuId", 0);
         }
         example.setOrderByClause("order_level");
		 return selectByExample(example);
    }
}
